<?php
namespace app\crm\model;

use app\common\model\TimeModel;

class CrmBusinessProduct extends TimeModel
{
	protected $deleteTime = 'delete_time';

	protected $insert = ['subtotal'];

	/**
	 * 小计
	 * @MethodAuthor: 聂哥
	 * @Date: 2023-01-17 19:20:01
	 */
	public function setSubtotalAttr($value,$data)
	{
		return $data['price'] * $data['nums'];
	}
	
	/**
     * 关联商品信息
     * @return \think\model\relation\BelongsTo
     */
    public function info()
    {
        return $this->belongsTo('\app\crm\model\BaseCourse', 'course_id', 'id');
    }
	
}